package com.wcs.exam.controller.admin.resp;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * Admin-考试-监控数据-阅卷-开始评阅-响应对象
 * </p>
 *
 * @author wcs
 * @since 2025-03-31
 */
@Getter
@Setter
@Accessors(chain = true)
@Schema(description = "Admin-考试-监控数据-阅卷-开始评阅-响应对象")
public class AdminExamDataEvaluationStartResp implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "考试记录ID")
    private Long recordId;

    @Schema(description = "考试类型(1：模拟考试、2：正式考试)")
    private Integer examType;

    @Schema(description = "考试名称")
    private String examName;

    @Schema(description = "考试说明")
    private String description;

    @Schema(description = "作答时长(单位：分钟)")
    private Integer answerTime;

    @Schema(description = "试卷ID")
    private Long paperId;

    @Schema(description = "试卷名称")
    private String paperName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @Schema(description = "交卷时间")
    private LocalDateTime submitTime;

    /*-------------------------------------------------- 拓展内容 --------------------------------------------------*/

    @Schema(description = "考试总分")
    private BigDecimal totalScore;

    @Schema(description = "及格分值")
    private BigDecimal passScore;

    @Schema(description = "考试大题")
    private List<ExamTitle> titles;


    @Data
    @Schema(name = "AdminExamDataEvaluationStartResp.ExamTitle", description = "Admin-考试-监控数据-阅卷-开始评阅-考试大题-响应对象")
    public static class ExamTitle implements Serializable {

        @Serial
        private static final long serialVersionUID = 1412169184591912535L;

        @Schema(description = "标题ID")
        private Long id;

        @Schema(description = "标题名称")
        private String titleName;

        @Schema(description = "标题分数")
        private BigDecimal titleScore;

        @Schema(description = "排序")
        private Integer sort;

        /*-------------------------------------------------- 拓展内容 --------------------------------------------------*/

        @Schema(description = "考试题目")
        private List<Question> questions;
    }

    @Data
    @Schema(name = "AdminExamDataEvaluationStartResp.Question", description = "Admin-考试-监控数据-阅卷-开始评阅-题目信息-响应对象")
    public static class Question implements Serializable {

        @Serial
        private static final long serialVersionUID = 2651414667159097463L;

        @Schema(description = "试题ID")
        private Long questionId;

        @Schema(description = "题目类型(1:单选题、2:多选题、3:判断题、4:填空题、5:简答题)")
        private Integer questionType;

        @Schema(description = "题目分值")
        private BigDecimal questionScore;

        @Schema(description = "多选题得分方式(1:设置漏选得分、2:每个正确选项得分)")
        private Integer multiScoreWay;

        @Schema(description = "多选题得分")
        private BigDecimal multiScore;

        @Schema(description = "填空题得分方式(1:每题得分、2:每空得分)")
        private Integer fillScoreWay;

        @Schema(description = "填空题得分(设置填空题得分方式为2时使用)")
        private BigDecimal fillScore;

        @Schema(description = "排序")
        private Integer sort;

        /*-------------------------------------------------- 拓展内容 --------------------------------------------------*/

        @Schema(description = "用户答案ID")
        private Long userAnswerId;

        @Schema(description = "用户答案")
        private String userAnswer;

        @Schema(description = "用户得分")
        private BigDecimal userScore;

        @Schema(description = "用户答题状态(1:错误、2:正确、3:待批改)")
        private Integer userAnswerStatus;

        @Schema(description = "评语")
        private String evaluationComment;

        @Schema(description = "AI评阅(false：否、true：是)")
        private Boolean aiGrading;

        @Schema(description = "AI用户得分")
        private BigDecimal aiUserScore;

        @Schema(description = "AI评分依据")
        private String aiGradingReason;

        @Schema(description = "难度等级(1:简单、2:一般、3:困难)")
        private Integer difficultyLevel;

        @Schema(description = "题目内容")
        private String questionTitle;

        @Schema(description = "题目答案")
        private String questionAnswer;

        @Schema(description = "填空数")
        private Integer optionCount;

        @Schema(description = "正确答案")
        private List<Long> questionAnswerIds;

        @Schema(description = "题目选项")
        private List<QuestionOption> options;
    }

    @Data
    @Schema(name = "AdminExamDataEvaluationStartResp.QuestionOption", description = "Admin-考试-监控数据-阅卷-开始评阅-题目选项-响应对象")
    public static class QuestionOption implements Serializable {

        @Serial
        private static final long serialVersionUID = 8514568720713846886L;

        @Schema(description = "主键ID")
        private Long id;

        @Schema(description = "题目ID")
        private Long questionId;

        @Schema(description = "选项内容")
        private String optionContent;

        @Schema(description = "排序")
        private Integer sort;
    }


}
